<template>
    <view class="nav pt-[40rpx] " v-if="navs.length>0">
        <view class="nav-item flex flex-wrap">
            <view
                v-for="(item, index) in navs"
                :key="index"
                class="flex flex-col items-center w-1/4 mb-[40rpx]"
                @click="handleClick(item.link)"
            >
                <u-image width="46px" height="46px" :src="item.image" alt="" />
                <view class="mt-[14rpx] text-center text-[#F7F7F7]">{{ item.name }}</view>
            </view>
        </view>
    </view>
</template>

<script setup lang="ts">
import { useAppStore } from '@/stores/app'
import { navigateTo,jumpTo } from '@/utils/util'

const props = defineProps({
    navs: {
        type: Object,
        default: () => ({})
    },
})

const handleClick = (link: any) => {
	let linkArr = {}
	if (link.indexOf('http') == 0) {
		jumpTo(link)
	} else {
		linkArr = { path: link }
	}
	if(link.indexOf('/pages/team/index') == 0){
		navigateTo(linkArr, 'switchTab')
	}else{
		navigateTo(linkArr)
	}
    
}
</script>

<style></style>
